Skip to main content

All Questions

2votes
7answers
734views

Shell Script to Normalize the data

We have requirement to normalize the data ... Item field is comma delimited and irregular and it may have any items from 0 to max (lets say 100) Input: key1|desc field|item1,item2,item3,item4|extra ...
Sanjay Dubey's user avatar
0votes
1answer
59views

Text processing - Modify based off two different files

I have two files named one.txt containing "297","237","14",NULL,"51.195.14.201","02:00:00:1a:1c:06","255.0.0.0","10.0.10.1","...
Teddy77's user avatar
  • 3,133
1vote
3answers
108views

get specific output in linux after string

Controller loading lists... ------------------------------------------------- command: select SERVICE_NAME from <table_name> ------------------------------------------------- ...
Leo Shukla's user avatar
0votes
2answers
196views

put a string in the beginning of a file, + a 3 digit incremental value

I want to put a string in the beginning of a file, + a 3 digit incremental value. Like this, ABC DEF GHI ... to string001 ABC string002 DEF string003 GHI ........... so on and so forth. Thankyou.
CLRC's user avatar
3votes
2answers
6kviews

How to iterate over list of list ( nested list ) in bash?

I have list of list such as : data = [ ['a', 'b' ], ['a1', 'b1'], ['c1', 'd1' ] ] I want to iterate over and access both elements of each nested list same time something like: for elements in ?? do ...
Aaditya Ura's user avatar
5votes
4answers
504views

Reformat timestamp in a pipe delimited file

I have a pipe delimited file with date time in this format yyyymmddhhmmss as below. John|Doe|TEST|20210728120821|[email protected] John|Davis|TEST|20210828120821|[email protected] John|Smith|TEST|...
Megatron's user avatar
-1votes
2answers
262views

Copy column B if column E or F is empty or comes with value 0

I have a CSV file, and I want to use a bash with command awk or anything else to modify this file. For example, I want to copy column B if column E or F comes empty or with the value of 0 AAAA, BBBB, ...
javila's user avatar
-1votes
1answer
137views

Custom data formatting and pattern matching

I am trying to format custom data using pattern match. I am not getting expected format. Though I am not shell script savvy but I was able to build a script based on references from multiple sources ...
Steve Rick's user avatar
4votes
3answers
176views

Transposing a rows to columns in a cyclic order using shell script

I would like to transpose rows to columns in a cyclic order and also ignoring column headers from 2nd occurrence. For example I have below data [ID] 10 [NAME] TOM [AGE] 25 [ID] 11 [NAME] SAM [AGE] 26 ...
Balaji's user avatar
1vote
2answers
2kviews

How can I delete everything after a word from multiple line in a file

In the following file: semi1245 5465 and taxes ?>:" foo 214 sdnfv 1>?<: Wed dsfsdf 46 and gsdgsd blah and blah taxes foo 214 sdnfv 1>?<: Wed sadfaads I want to delete ...
xjddo's user avatar
0votes
1answer
1kviews

Filter rows which has multiple conditions

I'm trying to generate new csv file from an existing csv file of 3.2 GB with , as delimiter. However, the output which I'm getting is a 0B csv file. Condition is to Filter all the tweets with lang = ‘...
vasish's user avatar
1vote
3answers
185views

Simple shell script unable to go through thousands of files; starts fine, but throws "unexpected EOF while looking for matching `"`" after some time

Shell Script in Question Let me explain what I am trying to do by e.g. so you can understand better. Let's say I have 100 .torrent files in a directory. 2 of them will download xxx.epub and yyy.epub ...
its_me's user avatar
  • 14.5k
2votes
2answers
345views

copy from psv file to excel file for multiple columns

My PSV file looks like Column1|Column2|Column3 Web_Value_in_file|123|OLA Tab_Value_out_file|453|OLA Source & target columns are different. I want to cut the value from column1 to multiple columns ...
Azar's user avatar
0votes
1answer
370views

Scripting curl requests in bash

What is given: Statistic server which gives reply on how many ip addresses within a range correspond to a given rule. Server which is contacted through http using pattern: curl http://server/p?q=(...
Bobster's user avatar
1vote
2answers
2kviews

How to get a random adjective or noun?

I did find a list of words in /usr/share/dict/words but I don't know if there's a way (an already existing way?) to split them up into their corresponding part of speech? Alternatively, I'm fine with ...
finefoot's user avatar

153050per page
close